package com.read.controller;

import com.read.common.response.RespResult;
import com.read.service.SystemRecommendService;
import com.read.util.RespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sh-sunb6
 * @description 系统推荐
 * @date 2019-03-15 15:32
 */
@Api(tags = "系统推荐 Controller")
@RestController
@RequestMapping("/sysRecommend")
public class SystemRecommendController {

    @Autowired
    private SystemRecommendService systemRecommendService;

    /**
     * @description 根据type、channel查询系统推荐小说
     * @author sh-sunb6
     * @date 2019-03-15 15:33
     */
    @ApiOperation(value = "查询系统推荐小说", notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(name="type", value="1新书推荐，2热门推荐，3主编推荐", required=true, paramType="query", dataType = "int", defaultValue = ""),
            @ApiImplicitParam(name="channel", value="1男生频道，2女生频道，3二次元，9其他", required=true, paramType="query", dataType = "int", defaultValue = "")
    })
    @GetMapping("/list")
    public RespResult getSysRecommendNovel(int type, int channel) {

        return RespUtil.success(systemRecommendService.selectSystemRecommendByTypeChannel(type, channel));
    }

}
